home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard;
-
- import com.sun.java.swing.ComboBoxEditor;
- import com.sun.java.swing.DefaultCellEditor;
- import com.sun.java.swing.JComboBox;
- import com.sun.java.swing.JTable;
- import java.awt.Component;
- import java.awt.event.ItemEvent;
- import java.awt.event.ItemListener;
-
- class WVPanelDbQueryWhere$CustomComboBoxCellEditor extends DefaultCellEditor implements ItemListener {
- // $FF: synthetic field
- private final WVPanelDbQueryWhere this$0;
- private int _editingRow;
- private int _editingColumn;
-
- public WVPanelDbQueryWhere$CustomComboBoxCellEditor(WVPanelDbQueryWhere this$0, JComboBox comboBox) {
- super(comboBox);
- this.this$0 = this$0;
- this.this$0 = this$0;
- this._editingRow = -1;
- this._editingColumn = -1;
- comboBox.addItemListener(this);
- }
-
- public Object getCellEditorValue() {
- this._editingRow = this.this$0._tblCriteria.getEditingRow();
- this._editingColumn = this.this$0._tblCriteria.getEditingColumn();
- return super.getCellEditorValue();
- }
-
- public void itemStateChanged(ItemEvent evt) {
- JComboBox comboBox = (JComboBox)((DefaultCellEditor)this).getComponent();
- ComboBoxEditor cbe = comboBox.getEditor();
- int rowCount = this.this$0._tblCriteria.getRowCount();
- int columnCount = this.this$0._tblCriteria.getColumnCount();
- if (cbe != null && this._editingRow > -1 && this._editingColumn > -1 && evt.getStateChange() != 2) {
- this.this$0._tblCriteria.setValueAt(cbe.getItem(), this._editingRow, this._editingColumn);
- this._editingRow = this._editingColumn = -1;
- }
-
- }
-
- public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
- this._editingRow = -1;
- this._editingColumn = -1;
- return super.getTableCellEditorComponent(table, value, isSelected, row, column);
- }
- }
-